package com.summer.order.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.summer.user.model.User;

@Entity
@Table(name = "user_order")
public class UserOrder implements Serializable {

	private static final long serialVersionUID = -299191142380442564L;

	private String id;

	private User user;
	
	private Set<UserDayFood> userDayFoods;
	
	private String cookbook_id;

	private String dateBetween;

	private Integer orderDayCount;

	private Double money;

	@Id
	@Column(name = "id", nullable = false, unique = true)
	public String getId() {
		return id;
	}

	@ManyToOne
	@JoinColumn(name = "user_id")
	public User getUser() {
		return user;
	}


	@OneToMany(cascade=CascadeType.ALL,mappedBy="userOrder",fetch=FetchType.LAZY)
	public Set<UserDayFood> getUserDayFoods() {
		return userDayFoods;
	}
	

	@Column(name = "date_between")
	public String getDateBetween() {
		return dateBetween;
	}

	@Column(name = "order_day_count")
	public Integer getOrderDayCount() {
		return orderDayCount;
	}

	@Column(name = "money")
	public Double getMoney() {
		return money;
	}
	

	@Column(name = "cookbook_id")
	public String getCookbook_id() {
		return cookbook_id;
	}

	public void setCookbook_id(String cookbook_id) {
		this.cookbook_id = cookbook_id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public void setDateBetween(String dateBetween) {
		this.dateBetween = dateBetween;
	}

	public void setOrderDayCount(Integer orderDayCount) {
		this.orderDayCount = orderDayCount;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public void setUserDayFoods(Set<UserDayFood> userDayFoods) {
		this.userDayFoods = userDayFoods;
	}

}
